package com.woniuxy.house.web;

import com.woniuxy.house.entity.PageBean;
import com.woniuxy.house.entity.Source;
import com.woniuxy.house.service.MonthlyRentService;
import com.woniuxy.house.vo.SourceVo;
import com.woniuxy.house.vo.ResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/monthlyRent")
public class MonthlyRentController {
@Autowired
    private MonthlyRentService monthlyRentService;
@RequestMapping("getPage")
/**@魏锦鹏
 * 点击月租按钮进入月租界面显示数据
 * 按条件查询月租数据
 */
    public ResponseEntity getAll(@RequestBody SourceVo monthly){
    PageBean<Source> pageData = monthlyRentService.getByPage(monthly.getSource()==null?new Source():monthly.getSource(), monthly.getPage() == null ? 1 : monthly.getPage());
    return new ResponseEntity<>("200","success",pageData);
}
}
